package com.example.backend.repository;


import com.example.backend.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;

import java.util.List;
import java.util.Optional;

public interface UserRepository extends JpaRepository<User,Integer>, CrudRepository<User,Integer> {

    Optional<User> findById(Integer id);
    User findByUsernameAndPassword(String username,String password);
    User findByUsername(String username);
    List<User> findByPassword (String password);
    List<User> findByPermission(Integer permission);
}
